package main;

import org.nustaq.serialization.FSTConfiguration;

public class FstSerialize implements ISerialize {

	private FSTConfiguration config = FSTConfiguration.getDefaultConfiguration();
	
	@Override
	public byte[] serialize(Object obj) {
		return config.asByteArray(obj);
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T> T unSerialize(byte[] bytes, Class<T> t) {
		return (T)config.asObject(bytes);
	}

}
